package setup

import (
	"log"
	"tone-agent/entity"

	"github.com/natefinch/lumberjack"
)

func SetupLogger() {
	logFile := entity.LogPath + "/" + entity.APPName + ".log"
	logger := &lumberjack.Logger{
		Filename:   logFile,
		MaxSize:    entity.LogMaxSize,
		MaxBackups: entity.LogMaxBackups,
		MaxAge:     entity.LogMaxAge,
		Compress:   true,
	}
	log.SetOutput(logger)
}
